home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.006 / xemacs-1 / lib / xemacs-19.13 / lisp / prim / float-sup.el < prev    next >
Encoding:
Text File  |  1995-05-12  |  2.0 KB  |  52 lines

  1. ;;; float-sup.el --- detect absence of floating-point support in XEmacs runtime
  2. ;; Keywords: internal
  3.  
  4. ;; Copyright (C) 1985, 1986, 1987 Free Software Foundation, Inc.
  5.  
  6. ;; This file is part of XEmacs.
  7.  
  8. ;; XEmacs is free software; you can redistribute it and/or modify it
  9. ;; under the terms of the GNU General Public License as published by
  10. ;; the Free Software Foundation; either version 2, or (at your option)
  11. ;; any later version.
  12.  
  13. ;; XEmacs is distributed in the hope that it will be useful, but
  14. ;; WITHOUT ANY WARRANTY; without even the implied warranty of
  15. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16. ;; General Public License for more details.
  17.  
  18. ;; You should have received a copy of the GNU General Public License
  19. ;; along with XEmacs; see the file COPYING.  If not, write to the Free
  20. ;; Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  
  22. ;; Provide a meaningful error message if we are running on
  23. ;; bare (non-float) emacs.
  24. ;; Can't test for 'floatp since that may be defined by float-imitation
  25. ;; packages like float.el in this very directory.
  26.  
  27. (or (featurep 'lisp-float-type)
  28.     (error "Floating point was disabled at compile time"))
  29.  
  30. ;; define pi and e via math-lib calls. (much less prone to killer typos.)
  31. (defconst pi (purecopy (* 4 (atan 1))) "The value of Pi (3.1415926...)")
  32. (defconst e (purecopy (exp 1)) "The value of e (2.7182818...)")
  33.  
  34. ;; Careful when editing this file ... typos here will be hard to spot.
  35. ;; (defconst pi       3.14159265358979323846264338327
  36. ;;  "The value of Pi (3.14159265358979323846264338327...)")
  37.  
  38. (defconst degrees-to-radians (purecopy (/ pi 180.0))
  39.   "Degrees to radian conversion constant")
  40. (defconst radians-to-degrees (purecopy (/ 180.0 pi))
  41.   "Radian to degree conversion constant")
  42.  
  43. ;; these expand to a single multiply by a float
  44. ;; when byte compiled
  45.  
  46. (defmacro degrees-to-radians (x)
  47.   "Convert ARG from degrees to radians."
  48.   (list '* (/ pi 180.0) x))
  49. (defmacro radians-to-degrees (x)
  50.   "Convert ARG from radians to degrees."
  51.   (list '* (/ 180.0 pi) x))
  52.